<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common_css :: commonHeader('资源库管理')"></head>
<body>
<!--搜索框-->
<form method="post" id="tabfrom">
    <div style="padding:2px" class="easyui-panel" title="数据查询">
        <table class="form-table">
            <tr>
                <td align="right">采集分类：</td>
                <td>
                    <input style="width:150px" id="selCategoryId"
                           data-options="valueField:'id',textField:'categoryName' ,panelHeight:'auto',prompt:'==请选择=='"
                           class="easyui-combobox"/>
                </td>
                <td align="right" width="10%">采集任务名称：</td>
                <td>
                    <input id="taskName" style="width:150px"/>
                    <a class="easyui-linkbutton" iconCls='icon-search' onclick="doSearch();">查询</a>
                </td>
            </tr>
        </table>
    </div>
    <br>
</form>
<div id="toolbar">
    <shiro:hasPermission name="kettle:job:task:add">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-add"
           onclick="addJobTask()">添加</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="kettle:job:task:edit">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-edit"
           onclick="editJobTask()">修改</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="kettle:job:task:del">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel"
           onclick="delJobTask()">删除</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="kettle:job:task:execute">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-reload"
           onclick="executeJobTask()">执行</a>
    </shiro:hasPermission>
</div>

<div id="dg"></div>

<div id="dlg" class="easyui-dialog" style="width:550px;height:510px"
     closed="true" modal="true" maximizable="true" resizable="true">
    <form id="myform" method="post">
        <div style="padding:20px">
            <table cellpadding="2px" cellspacing="0" class="form-table">
                <input type="hidden" class="easyui-validatebox" name="id"/>
                <tr>
                    <td align="right">采集分类：</td>
                    <td><input id="categoryId" name="categoryId" editable="false"
                               data-options="valueField:'id',textField:'categoryName' ,panelHeight:'auto',prompt:'==请选择=='"
                               class="easyui-combobox"/></td>
                </tr>
                <tr>
                    <td align="right">名称：</td>
                    <td><input class="easyui-validatebox" name="name"/></td>
                </tr>
                <tr>
                    <td align="right">状态：</td>
                    <td>
                        <input name="status" id="taskStatus" editable="false"
                               class="easyui-combobox" data-options="prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
                                    data: [{ label: '1',  value: '启用' },{ label: '2', value: '禁用'}]"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">类型：</td>
                    <td>
                        <input name="ftype" id="taskFtype" editable="false"
                               class="easyui-combobox" data-options="prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
                                    data: [{ label: '1',  value: '标准模板' },{ label: '2',  value: '导入的数据' }]"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">顺序：</td>
                    <td><input class="easyui-validatebox"  name="sequence" id="taskSequence"
                               missingMessage="请输入字段位数,必须大于0正整数！" validType="integerZero"/></td>
                </tr>
                <tr>
                    <td align="right">说明：</td>
                    <td>
                        <input class="easyui-textbox" name="description"
                               data-options="multiline:true" style="height:80px;width:350px"/>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</div>


<div id="dlgDetail" class="easyui-dialog" style="width:950px;height:560px"
     closed="true" modal="true" maximizable="true" resizable="true" buttons="#dlg-buttonsDetail">
    <div id="dgDetail"></div>

    <input type="hidden" name="task_id" id="task_id"/>
    <div id="dlg-buttonsDetail" style="text-align:center">
        <shiro:hasPermission name="kettle:job:task:detail:add">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add"
               onclick="addJobTaskDetailInfo()">添加</a>
        </shiro:hasPermission>
        <shiro:hasPermission name="kettle:job:task:detail:edit">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit"
               onclick="editJobTaskDetailInfo()">修改</a>
        </shiro:hasPermission>
        <shiro:hasPermission name="kettle:job:task:detail:del">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"
               onclick="delJobTaskDetailInfo()">删除</a>
        </shiro:hasPermission>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-back"
           onclick="$('#dlgDetail').dialog('close')">返回</a>
    </div>
</div>


<div id="dlgDetailInfo" class="easyui-dialog" style="width:850px;height:550px"
     closed="true" modal="true" maximizable="true" resizable="true">
    <form id="myformDetail" method="post">
        <div style="padding:20px">
            <table cellpadding="2px" cellspacing="0" class="form-table">
                <input type="hidden" name="taskId" id="taskId"/>
                <input type="hidden" name="id" id="id"/>
                <tr>
                    <td align="right">执行类型：</td>
                    <td>
                        <input id="ftype" name="ftype" editable="false"
                               class="easyui-combobox" data-options="required:false,prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
                                    data: [{ label: '1',  value: '输入输出' },{ label: '2', value: '执行SQL'},
                                    { label: '3', value: '读取DBF'},{ label: '4', value: '读取EXECL'}]"
                               missingMessage="请选择执行类型"/>
                    </td>
                </tr>
                <tr id="inputDataIdTr">
                    <td align="right" id="inputDataText">输入数据库：</td>
                    <td>
                        <input id="inputDataId" name="inputDataId" editable="false"
                               data-options="required:false,valueField:'id',textField:'name' ,panelHeight:'auto',prompt:'==请选择=='"
                               class="easyui-combobox" missingMessage="请选择输入数据库"/>
                    </td>
                </tr>
                <tr id="outputDataIdTr">
                    <td align="right">输出数据库：</td>
                    <td>
                        <input id="outputDataId" name="outputDataId" editable="false"
                               data-options="required:false,valueField:'id',textField:'name' ,panelHeight:'auto',prompt:'==请选择=='"
                               class="easyui-combobox" missingMessage="请选择输出数据库"/>
                    </td>
                </tr>
                <tr id="outputTableTr">
                    <td align="right">输出表名：</td>
                    <td><input class="easyui-validatebox" data-options="required:false" missingMessage="请输入输出表名"
                               name="outputTable" id="outputTable"/></td>
                </tr>
                <tr>
                    <td align="right">状态：</td>
                    <td>
                        <input id="statusDetail" name="status" editable="false"
                               class="easyui-combobox" data-options="required:false,prompt:'==请选择==',panelHeight:'auto', valueField: 'label', textField: 'value',
                                    data: [{ label: '1',  value: '启用' },{ label: '2', value: '禁用'}]"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">顺序：</td>
                    <td><input class="easyui-validatebox" data-options="required:false"
                               missingMessage="请输入字段位数,必须大于0正整数！" validType="integerZero" id="taskDetailSequence" name="sequence"/></td>
                </tr>
                <tr>
                    <td align="right" id="inputSqlText">输入语句：</td>
                    <td>
                        <input class="easyui-textbox" name="inputSql" id="inputSql" missingMessage=""
                               data-options="required:false,multiline:true" style="height:250px;width:650px"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">说明：</td>
                    <td>
                        <input class="easyui-textbox" name="description"
                               data-options="multiline:true" style="height:80px;width:650px"/>
                    </td>
                </tr>
            </table>
        </div>

    </form>
</div>


<div id="dlgExecuteJobTask" class="easyui-dialog" style="width:650px;height:450px"
     closed="true" modal="true" maximizable="true" resizable="true">
    <form id="myformExecuteJobTask" method="post">
        <div style="padding:20px" id="paramTable">
        </div>

    </form>
</div>

<div id="dlgExecuteJobRecord" class="easyui-dialog" style="width:850px;height:520px"
     closed="true" modal="true" maximizable="true" resizable="true">
    <form id="myformExecuteJobRecord" method="post">
        <div style="padding:0px">
            <table cellpadding="0px" cellspacing="0" class="form-table">
                <tr>
                    <td>
                        <input class="easyui-textbox" id="jobRecord"
                               data-options="multiline:true" style="height:500px;width:830px"/>
                    </td>
                </tr>
            </table>
        </div>

    </form>
</div>

<div th:include="common_js :: commJS"></div>
<script type="text/javascript"
        th:src="@{/js/kettle/jobTask.js}"></script>
<script type="text/javascript"
        th:src="@{/js/kettle/jobTaskCommon.js}"></script>
</body>
</html>
